﻿// 文件路径：AyuBookmark.Common/Models/User.cs
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AyuBookmark.Common.Models
{
    /// <summary>
    /// 用户实体类
    /// </summary>
    [Table("Users")]
    public class User
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required]
        [StringLength(50)]
        public string Username { get; set; }

        [Required]
        [StringLength(100)]
        public string Email { get; set; }

        [Required]
        public string PasswordHash { get; set; }

        public DateTime CreatedTime { get; set; } = DateTime.Now;

        public DateTime? LastLoginTime { get; set; }

        // 导航属性
        public virtual ICollection<Notification> Notifications { get; set; }
    }
}